package com.disability_federation.controller;

import com.disability_federation.mapper.MapperAmountUsageDetails;
import com.disability_federation.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 残保金使用明细操作接口
 */
@RestController
@CrossOrigin
public class ControllerAmountsUsageDetails {

    @Autowired
    private MapperAmountUsageDetails mapperAmountUsageDetails;

    /**
     * 查询全部残保金使用明细
     * 默认时间升序排序
     */
    @RequestMapping("AUD/query")
    public Result query(){
        return Result.success(mapperAmountUsageDetails.query());
    }

    /**
     * 查询全部残保金使用明细
     * 时间降序排序
     */
    @RequestMapping("AUD/query/time_desc")
    public Result queryDesc(){
        return Result.success(mapperAmountUsageDetails.queryDesc());
    }

    /**
     * 查询全部残保金使用明细
     * 被使用人升序排序
     */
    @RequestMapping("AUD/query/user_asc")
    public Result queryUserAsc(){
        return Result.success(mapperAmountUsageDetails.queryUserAsc());
    }

    /**
     * 查询全部残保金使用明细
     * 被使用人降序排序
     */
    @RequestMapping("AUD/query/user_desc")
    public Result queryUserDesc(){
        return Result.success(mapperAmountUsageDetails.queryUserDesc());
    }

    /**
     * 查询全部残保金使用明细
     * 单位升序排序
     */
    @RequestMapping("AUD/query/enterprise_asc")
    public Result queryEnterpriseAsc(){
        return Result.success(mapperAmountUsageDetails.queryEnterpriseAsc());
    }

    /**
     * 查询全部残保金使用明细
     * 单位降序排序
     */
    @RequestMapping("AUD/query/enterprise_desc")
    public Result queryEnterpriseDesc(){
        return Result.success(mapperAmountUsageDetails.queryEnterpriseDesc());
    }

    /**
     * 查询全部残保金使用明细
     * 金额升序排序
     */
    @RequestMapping("AUD/query/money_asc")
    public Result queryMoneyAsc(){
        return Result.success(mapperAmountUsageDetails.queryMoneyAsc());
    }

    /**
     * 查询全部残保金使用明细
     * 金额降序排序
     */
    @RequestMapping("AUD/query/money_desc")
    public Result queryMoneyDesc(){
        return Result.success(mapperAmountUsageDetails.queryMoneyDesc());
    }

    /**
     * 根据条件查询残保金使用明细
     * 默认时间升序排序
     */
    @RequestMapping("AUD/queryByCondition")
    public Result queryByCondition(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByCondition(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 时间降序排序
     */
    @RequestMapping("AUD/queryByCondition/time_desc")
    public Result queryByConditionDesc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionDesc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 被使用人升序排序
     */
    @RequestMapping("AUD/queryByCondition/user_asc")
    public Result queryByConditionUserAsc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionUserAsc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 被使用人降序排序
     */
    @RequestMapping("AUD/queryByCondition/user_desc")
    public Result queryByConditionUserDesc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionUserDesc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 单位升序排序
     */
    @RequestMapping("AUD/queryByCondition/enterprise_asc")
    public Result queryByConditionEnterpriseAsc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionEnterpriseAsc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 单位降序排序
     */
    @RequestMapping("AUD/queryByCondition/enterprise_desc")
    public Result queryByConditionEnterpriseDesc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionEnterpriseDesc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 金额升序排序
     */
    @RequestMapping("AUD/queryByCondition/money_asc")
    public Result queryByConditionMoneyAsc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionMoneyAsc(userName, unitName, money1, money2));
    }

    /**
     * 根据条件查询残保金使用明细
     * 金额降序排序
     */
    @RequestMapping("AUD/queryByCondition/money_desc")
    public Result queryByConditionMoneyDesc(String userName, String unitName,Integer money1, Integer money2){
        return Result.success(mapperAmountUsageDetails.queryByConditionMoneyDesc(userName, unitName, money1, money2));
    }
}
